import request from '@/utils/request'
import { GEN_SERVER } from '@/config/baseUrl'

// 查询工位信息列表
export function listWorkStation(data) {
  return request({
    url: GEN_SERVER['produce-server'] + '/data/workStation/list',
    method: 'post',
    data: data
  })
}

// 查询工位信息详细
export function getWorkStation(id) {
  return request({
    url: GEN_SERVER['produce-server'] + '/data/workStation/detail',
    method: 'get',
    params: {
        id
    }
  })
}

// 新增/修改工位信息
export function addOrUpdateWorkStation(data) {
  return request({
    url: GEN_SERVER['produce-server'] + '/data/workStation/addOrUpdate',
    method: 'post',
    data: data
  })
}

// 删除工位信息
export function delWorkStation(id) {
  return request({
    url: GEN_SERVER['produce-server'] + '/data/workStation/deleteByIds',
    method: 'post',
    params: {
      ids: id
    }
  })
}

// 导出工位信息
export function exportWorkStation(query) {
  return request({
    url: GEN_SERVER['produce-server'] + '/data/workStation/export',
    method: 'post',
    data: query
  })
}

// 查询工位不可用人员
export function getUnSelectableUsernamesByLineId(lineId) {
  return request({
    url: GEN_SERVER['produce-server'] + '/data/workStation/getUnSelectableUsernamesByLineId',
    method: 'get',
    params: {
      lineId
    }
  })
}